/**
 * \license
 * Copyright Lassi Marttala 2013
 * 
 * This file is part of dlt2jpa.
 *
 * dlt2jpa is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * dlt2jpa is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with dlt2jpa.  If not, see <http://www.gnu.org/licenses/>.
 */

package net.fizzl.dlt.message;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Transient;

@Entity
public class DltStandardHeader {
	@Id
	private long id;
	
	// Mandatory stuff
	private boolean useExtendedHeader;
	private boolean useBigEndian;
	private boolean useEcuId;
	private boolean useSessionId;
	private boolean useTimeStamp;
	private int		protocolVersion;
	
	private short 	messageCounter;
	private int		messageLength;
	
	// Optional values
	private String  deviceId;
	private long	sessionNumber;
	private long	timeStamp;
	
	// Getters and setters
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public boolean isUseExtendedHeader() {
		return useExtendedHeader;
	}
	public void setUseExtendedHeader(boolean useExtendedHeader) {
		this.useExtendedHeader = useExtendedHeader;
	}
	public boolean isUseBigEndian() {
		return useBigEndian;
	}
	public void setUseBigEndian(boolean useBigEndian) {
		this.useBigEndian = useBigEndian;
	}
	public boolean isUseEcuId() {
		return useEcuId;
	}
	public void setUseEcuId(boolean useEcuId) {
		this.useEcuId = useEcuId;
	}
	public boolean isUseSessionId() {
		return useSessionId;
	}
	public void setUseSessionId(boolean useSessionId) {
		this.useSessionId = useSessionId;
	}
	public boolean isUseTimeStamp() {
		return useTimeStamp;
	}
	public void setUseTimeStamp(boolean useTimeStamp) {
		this.useTimeStamp = useTimeStamp;
	}
	public int getProtocolVersion() {
		return protocolVersion;
	}
	public void setProtocolVersion(int protocolVersion) {
		this.protocolVersion = protocolVersion;
	}
	public short getMessageCounter() {
		return messageCounter;
	}
	public void setMessageCounter(short messageCounter) {
		this.messageCounter = messageCounter;
	}
	public int getMessageLength() {
		return messageLength;
	}
	public void setMessageLength(int messageLength) {
		this.messageLength = messageLength;
	}
	public String getDeviceId() {
		return deviceId;
	}
	public void setDeviceId(String deviceId) {
		this.deviceId = deviceId;
	}
	public long getSessionNumber() {
		return sessionNumber;
	}
	public void setSessionNumber(long sessionNumber) {
		this.sessionNumber = sessionNumber;
	}
	public long getTimeStamp() {
		return timeStamp;
	}
	public void setTimeStamp(long timeStamp) {
		this.timeStamp = timeStamp;
	}
	
	// Non-db stuff
	@Transient
	private int length;
	public int getLength() {
		return length;
	}
	public void setLength(int length) {
		this.length = length;
	}
}
